<?php

namespace mpend\modules\share\controllers;

use Yii;
use mpend\components\Controller;
use mpend\modules\share\models\TeamBookMemberView;

/**
 * 邀请工人
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class WorkerController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET']
        ];
    }

    /**
     * 邀请绑定微信
     * @inheritdoc
     */
    public function actionBind($id) {
        $model = TeamBookMemberView::find()->active(TeamBookMemberView::STATUS_ACTIVE)->andWhere([
            'id' => $id
        ])->one();
        if (!$model) {
            parent::error('未查询到记工薄工人信息');
        }
        return $model;
    }

}
